package com.integration.gateway;

import com.integration.gateway.pojo.OrderItem;
import lombok.extern.slf4j.Slf4j;
import org.springframework.integration.annotation.MessageEndpoint;
import org.springframework.integration.annotation.Router;
@Slf4j
@MessageEndpoint
public class DrinkRouter {

    @Router(inputChannel = "drinks")
    public String routerOrderChanel(OrderItem orderItem){
        log.info("=== router Order Chanel to coldDrinks or hotDrinks ===");
        return orderItem.isIced() ? "coldDrinks" : "hotDrinks";
    }
}
